<?php


namespace Mslynn\Subscribe\Block;


use Magento\Framework\Image;
use Mslynn\Subscribe\Helper\Data;

class SubscribeBlock extends \Magento\Framework\View\Element\Template
{
    protected $_logo;
    protected $_config;
    protected $_image;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Theme\Block\Html\Header\Logo $logo,
        Data $config,
        array $data = []
    )
    {

        $this->_config = $config;
        $this->_logo = $logo;
        parent::__construct($context, $data);
    }

    /**
     * Get logo image URL
     *
     * @return string
     */
    public function getLogoSrc()
    {
        return $this->_logo->getLogoSrc();
    }

    /**
     * Get logo text
     *
     * @return string
     */
    public function getLogoAlt()
    {
        return $this->_logo->getLogoAlt();
    }

    /**
     * Get logo width
     *
     * @return int
     */
    public function getLogoWidth()
    {
        return $this->_logo->getLogoWidth();
    }

    /**
     * Get logo height
     *
     * @return int
     */
    public function getLogoHeight()
    {
        return $this->_logo->getLogoHeight();
    }

    /**
     * 获取背景图
     * @return string
     */
    public function getBackgroud()
    {
        if ($this->_config->getGeneralConfig('background')) {
            return $this->getUrl('media/logo') . $this->_config->getGeneralConfig('background');
        }
    }
    /**
     * 获取移动端背景图
     */

    public function getBackgroudMobile()
    {
        if ($this->_config->getGeneralConfig('backgroundMobile')) {
            return $this->getUrl('media/logo') . $this->_config->getGeneralConfig('backgroundMobile');
        }
    }
    /**
     * 是否开启
     * @return mixed
     */
    public function getEnable()
    {
        return $this->_config->getGeneralConfig('enable');
    }

    /**
     * Retrieve form action url and set "secure" param to avoid confirm
     * message when we submit form from secure page to unsecure
     *
     * @return string
     */
    public function getFormActionUrl()
    {
        return $this->getUrl('newsletter/subscriber/new', ['_secure' => true]);
    }
    /**
     * @return mixed
     */
    public function getTitleMobile(){
        return $this->_config->getGeneralConfig('titleMobile');
    }

    /**
     * @return mixed
     */
    public function getContentMobile(){
        return $this->_config->getGeneralConfig('contentMobile');
    }
    /**
     * @return mixed
     */
    public function getTitle(){
        return $this->_config->getGeneralConfig('title');
    }

    /**
     * @return mixed
     */
    public function getContent(){
        return $this->_config->getGeneralConfig('content');
    }
    public function getTime1(){
        return $this->_config->getGeneralConfig('time1');
    }
    public function getTime2(){
        return $this->_config->getGeneralConfig('time2');
    }
    public function getBaseUrl()
    {
        return parent::getBaseUrl(); // TODO: Change the autogenerated stub
    }
}